import { Module, Global } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { MenuService } from './menu.service';
import { MenuController } from './menu.controller';
import { SysMenuEntity } from './entities/menu.entity';
import { SysRoleWithMenuEntity } from '../role/entities/role-width-menu.entity';
import { UserPermissionService } from '../user-permission/user-permission.service';
import { SysUserWithRoleEntity } from '../user/entities/user-width-role.entity';
import { SysRoleEntity } from '../role/entities/role.entity';

@Global()
@Module({
  imports: [TypeOrmModule.forFeature([SysMenuEntity, SysRoleWithMenuEntity, SysUserWithRoleEntity, SysRoleEntity])],
  controllers: [MenuController],
  providers: [MenuService, UserPermissionService],
  exports: [MenuService],
})
export class MenuModule {}
